package com.project.common.domain.po;

import javax.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import java.io.Serializable;

/**
 * BasePoPrimaryKey
 * UserAuditorAware
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@MappedSuperclass
@EntityListeners({AuditingEntityListener.class})
public class BasePrimaryKeyPO extends BaseVersionPO implements Serializable {
    @Id
    @GeneratedValue(generator = "snowflakeId", strategy = GenerationType.IDENTITY)
    @GenericGenerator(name = "snowflakeId", strategy = "com.project.common.domain.IdGenerator")
    private Long id;
}
